<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>LCV Framework: i2c-dev.h Quellcode</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Erzeugt von Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Hauptseite</span></a></li>
    <li><a href="classes.html"><span>Datenstrukturen</span></a></li>
    <li class="current"><a href="files.html"><span>Dateien</span></a></li>
  </ul>
</div>
<h1>i2c-dev.h</h1><a href="i2c-dev_8h.html">gehe zur Dokumentation dieser Datei</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> *</span>
<a name="l00003"></a>00003 <span class="comment"> *    Rev:          $Id: i2c-dev.h,v 1.1.1.1 2007/10/03 08:15:48 dstadelmann Exp $</span>
<a name="l00004"></a>00004 <span class="comment"> *    Revision:     $Revision: 1.1.1.1 $</span>
<a name="l00005"></a>00005 <span class="comment"> *    Source:       $Source: /cvs/lcv/SW/uclinux-dist/user/blkfin-apps/ppifcd-cgi-lcv/src/i2c-dev.h,v $  </span>
<a name="l00006"></a>00006 <span class="comment"> *    Created:      06.07.2005 18:16</span>
<a name="l00007"></a>00007 <span class="comment"> *    Author:       Michael Hennerich</span>
<a name="l00008"></a>00008 <span class="comment"> *    mail:         hennerich@blackfin.uclinux.org</span>
<a name="l00009"></a>00009 <span class="comment"> *    Description:  User Space friendly include files for /dev/I2C-x access </span>
<a name="l00010"></a>00010 <span class="comment"> *                  </span>
<a name="l00011"></a>00011 <span class="comment"> *   Copyright (C) 2005 Analog Devices Inc.</span>
<a name="l00012"></a>00012 <span class="comment"> *</span>
<a name="l00013"></a>00013 <span class="comment"> *   This program is free software; you can redistribute it and/or modify</span>
<a name="l00014"></a>00014 <span class="comment"> *   it under the terms of the GNU General Public License as published by</span>
<a name="l00015"></a>00015 <span class="comment"> *   the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00016"></a>00016 <span class="comment"> *   (at your option) any later version.</span>
<a name="l00017"></a>00017 <span class="comment"> *</span>
<a name="l00018"></a>00018 <span class="comment"> *   This program is distributed in the hope that it will be useful,</span>
<a name="l00019"></a>00019 <span class="comment"> *   but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00020"></a>00020 <span class="comment"> *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00021"></a>00021 <span class="comment"> *   GNU General Public License for more details.</span>
<a name="l00022"></a>00022 <span class="comment"> *</span>
<a name="l00023"></a>00023 <span class="comment"> *   You should have received a copy of the GNU General Public License</span>
<a name="l00024"></a>00024 <span class="comment"> *   along with this program; if not, write to the Free Software</span>
<a name="l00025"></a>00025 <span class="comment"> *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span>
<a name="l00026"></a>00026 <span class="comment"> *</span>
<a name="l00027"></a>00027 <span class="comment"> *</span>
<a name="l00028"></a>00028 <span class="comment"> ****************************************************************************</span>
<a name="l00029"></a>00029 <span class="comment"> * MODIFICATION HISTORY:</span>
<a name="l00030"></a>00030 <span class="comment"> ***************************************************************************/</span> 
<a name="l00031"></a>00031 <span class="comment">/*</span>
<a name="l00032"></a>00032 <span class="comment">    i2c-dev.h - i2c-bus driver, char device interface</span>
<a name="l00033"></a>00033 <span class="comment"></span>
<a name="l00034"></a>00034 <span class="comment">    Copyright (C) 1995-97 Simon G. Vogl</span>
<a name="l00035"></a>00035 <span class="comment">    Copyright (C) 1998-99 Frodo Looijaard &lt;frodol@dds.nl&gt;</span>
<a name="l00036"></a>00036 <span class="comment"></span>
<a name="l00037"></a>00037 <span class="comment">    This program is free software; you can redistribute it and/or modify</span>
<a name="l00038"></a>00038 <span class="comment">    it under the terms of the GNU General Public License as published by</span>
<a name="l00039"></a>00039 <span class="comment">    the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00040"></a>00040 <span class="comment">    (at your option) any later version.</span>
<a name="l00041"></a>00041 <span class="comment"></span>
<a name="l00042"></a>00042 <span class="comment">    This program is distributed in the hope that it will be useful,</span>
<a name="l00043"></a>00043 <span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00044"></a>00044 <span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00045"></a>00045 <span class="comment">    GNU General Public License for more details.</span>
<a name="l00046"></a>00046 <span class="comment"></span>
<a name="l00047"></a>00047 <span class="comment">    You should have received a copy of the GNU General Public License</span>
<a name="l00048"></a>00048 <span class="comment">    along with this program; if not, write to the Free Software</span>
<a name="l00049"></a>00049 <span class="comment">    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span>
<a name="l00050"></a>00050 <span class="comment">*/</span>
<a name="l00051"></a>00051 
<a name="l00052"></a>00052 
<a name="l00053"></a>00053 <span class="preprocessor">#ifndef _LINUX_I2C_DEV_H</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#define _LINUX_I2C_DEV_H</span>
<a name="l00055"></a>00055 <span class="preprocessor"></span>
<a name="l00056"></a>00056 
<a name="l00057"></a>00057 
<a name="l00058"></a>00058 <span class="comment">/* Some IOCTL commands are defined in &lt;linux/i2c.h&gt; */</span>
<a name="l00059"></a>00059 <span class="comment">/* Note: 10-bit addresses are NOT supported! */</span>
<a name="l00060"></a>00060 
<a name="l00061"></a><a class="code" href="structi2c__msg.html">00061</a> <span class="keyword">struct </span><a class="code" href="structi2c__msg.html">i2c_msg</a> {
<a name="l00062"></a><a class="code" href="structi2c__msg.html#b4cc69b8a61df46372663900e9d4453a">00062</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="structi2c__msg.html#b4cc69b8a61df46372663900e9d4453a">addr</a>;    <span class="comment">/* slave address            */</span>
<a name="l00063"></a><a class="code" href="structi2c__msg.html#4b3bc1a36147fedfbdf9a15cc6ae88d9">00063</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="structi2c__msg.html#4b3bc1a36147fedfbdf9a15cc6ae88d9">flags</a>;       
<a name="l00064"></a><a class="code" href="i2c-dev_8h.html#be53ff15e0717ccbd1d4c656c09ee53a">00064</a> <span class="preprocessor">#define I2C_M_TEN   0x10    </span><span class="comment">/* we have a ten bit chip address   */</span>
<a name="l00065"></a><a class="code" href="i2c-dev_8h.html#db8eddbb89e88c4fc0e44306fc878b85">00065</a> <span class="preprocessor">#define I2C_M_RD    0x01</span>
<a name="l00066"></a><a class="code" href="i2c-dev_8h.html#7a467d37a113d97496f0fa69c6c15650">00066</a> <span class="preprocessor"></span><span class="preprocessor">#define I2C_M_NOSTART   0x4000</span>
<a name="l00067"></a><a class="code" href="i2c-dev_8h.html#6392dd65e4022a3ed20fc2d7dca3392f">00067</a> <span class="preprocessor"></span><span class="preprocessor">#define I2C_M_REV_DIR_ADDR  0x2000</span>
<a name="l00068"></a><a class="code" href="i2c-dev_8h.html#0629c50bb05b4c037e726373da50755b">00068</a> <span class="preprocessor"></span><span class="preprocessor">#define I2C_M_IGNORE_NAK    0x1000</span>
<a name="l00069"></a><a class="code" href="i2c-dev_8h.html#db8351c5c02ca2b6909baa9d374ff6d4">00069</a> <span class="preprocessor"></span><span class="preprocessor">#define I2C_M_NO_RD_ACK     0x0800</span>
<a name="l00070"></a><a class="code" href="structi2c__msg.html#19562d60739c88c022e18999c3510e4f">00070</a> <span class="preprocessor"></span>    <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="structi2c__msg.html#19562d60739c88c022e18999c3510e4f">len</a>;     <span class="comment">/* msg length               */</span>
<a name="l00071"></a><a class="code" href="structi2c__msg.html#e38efa3fb3dd7ab2ea7b4c3ebf0045f8">00071</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *<a class="code" href="structi2c__msg.html#e38efa3fb3dd7ab2ea7b4c3ebf0045f8">buf</a>;     <span class="comment">/* pointer to msg data          */</span>
<a name="l00072"></a>00072 };
<a name="l00073"></a>00073 
<a name="l00074"></a>00074 <span class="comment">/* This is the structure as used in the I2C_SMBUS ioctl call */</span>
<a name="l00075"></a>00075 
<a name="l00076"></a>00076 
<a name="l00077"></a>00077 
<a name="l00078"></a><a class="code" href="structi2c__smbus__ioctl__data.html">00078</a> <span class="keyword">struct </span><a class="code" href="structi2c__smbus__ioctl__data.html">i2c_smbus_ioctl_data</a> {
<a name="l00079"></a><a class="code" href="structi2c__smbus__ioctl__data.html#b3385c2e7d1ae6940b0b869468ed3be4">00079</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="structi2c__smbus__ioctl__data.html#b3385c2e7d1ae6940b0b869468ed3be4">read_write</a>;
<a name="l00080"></a><a class="code" href="structi2c__smbus__ioctl__data.html#085cb07c997115e758f769a746c6f259">00080</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="structi2c__smbus__ioctl__data.html#085cb07c997115e758f769a746c6f259">command</a>;
<a name="l00081"></a><a class="code" href="structi2c__smbus__ioctl__data.html#249ae6adc3bd99c2530e1187f9f8fad7">00081</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structi2c__smbus__ioctl__data.html#249ae6adc3bd99c2530e1187f9f8fad7">size</a>;
<a name="l00082"></a><a class="code" href="structi2c__smbus__ioctl__data.html#f5a53e4ed38f278bd5fb62a65b67432d">00082</a>     <span class="keyword">union </span>i2c_smbus_data  *<a class="code" href="structi2c__smbus__ioctl__data.html#f5a53e4ed38f278bd5fb62a65b67432d">data</a>;
<a name="l00083"></a>00083 };
<a name="l00084"></a>00084 
<a name="l00085"></a>00085 <span class="comment">/* This is the structure as used in the I2C_RDWR ioctl call */</span>
<a name="l00086"></a><a class="code" href="structi2c__rdwr__ioctl__data.html">00086</a> <span class="keyword">struct </span><a class="code" href="structi2c__rdwr__ioctl__data.html">i2c_rdwr_ioctl_data</a> {
<a name="l00087"></a><a class="code" href="structi2c__rdwr__ioctl__data.html#436bb0f35544ff79b2c0ac3570f5b7f0">00087</a>     <span class="keyword">struct </span><a class="code" href="structi2c__msg.html">i2c_msg</a>  *<a class="code" href="structi2c__rdwr__ioctl__data.html#436bb0f35544ff79b2c0ac3570f5b7f0">msgs</a>;  <span class="comment">/* pointers to i2c_msgs */</span>
<a name="l00088"></a><a class="code" href="structi2c__rdwr__ioctl__data.html#33b02a11d55f6079e074fd7a1e6affb6">00088</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structi2c__rdwr__ioctl__data.html#33b02a11d55f6079e074fd7a1e6affb6">nmsgs</a>;         <span class="comment">/* number of i2c_msgs */</span>
<a name="l00089"></a>00089 };
<a name="l00090"></a>00090 
<a name="l00091"></a>00091 
<a name="l00092"></a><a class="code" href="i2c-dev_8h.html#272399a0175400a2ebb55ff518a85012">00092</a> <span class="preprocessor">#define  I2C_RDRW_IOCTL_MAX_MSGS    42</span>
<a name="l00093"></a>00093 <span class="preprocessor"></span>
<a name="l00094"></a>00094 <span class="comment">/* ----- commands for the ioctl like i2c_command call:</span>
<a name="l00095"></a>00095 <span class="comment"> * note that additional calls are defined in the algorithm and hw </span>
<a name="l00096"></a>00096 <span class="comment"> *  dependent layers - these can be listed here, or see the </span>
<a name="l00097"></a>00097 <span class="comment"> *  corresponding header files.</span>
<a name="l00098"></a>00098 <span class="comment"> */</span>
<a name="l00099"></a>00099 <span class="comment">/* -&gt; bit-adapter specific ioctls   */</span>
<a name="l00100"></a><a class="code" href="i2c-dev_8h.html#e8b7ab32459314e0c0162974f2ce22e1">00100</a> <span class="preprocessor">#define I2C_RETRIES 0x0701  </span><span class="comment">/* number of times a device address      */</span>
<a name="l00101"></a>00101                             <span class="comment">/* should be polled when not            */</span>
<a name="l00102"></a>00102                             <span class="comment">/* acknowledging            */</span>
<a name="l00103"></a><a class="code" href="i2c-dev_8h.html#fa3215f0aa766367f5d34bee80929152">00103</a> <span class="preprocessor">#define I2C_TIMEOUT 0x0702  </span><span class="comment">/* set timeout - call with int      */</span>
<a name="l00104"></a>00104 
<a name="l00105"></a>00105 
<a name="l00106"></a>00106 <span class="comment">/* this is for i2c-dev.c    */</span>
<a name="l00107"></a><a class="code" href="i2c-dev_8h.html#b15137f7c592d05573de99f078516157">00107</a> <span class="preprocessor">#define I2C_SLAVE   0x0703  </span><span class="comment">/* Change slave address         */</span>
<a name="l00108"></a>00108                             <span class="comment">/* Attn.: Slave address is 7 or 10 bits */</span>
<a name="l00109"></a><a class="code" href="i2c-dev_8h.html#fb1764d4b58fb542306c715ad6a28a42">00109</a> <span class="preprocessor">#define I2C_SLAVE_FORCE 0x0706  </span><span class="comment">/* Change slave address         */</span>
<a name="l00110"></a>00110                             <span class="comment">/* Attn.: Slave address is 7 or 10 bits */</span>
<a name="l00111"></a>00111                             <span class="comment">/* This changes the address, even if it */</span>
<a name="l00112"></a>00112                             <span class="comment">/* is already taken!            */</span>
<a name="l00113"></a><a class="code" href="i2c-dev_8h.html#2a0b1f3843e98977be7476579c851305">00113</a> <span class="preprocessor">#define I2C_TENBIT  0x0704  </span><span class="comment">/* 0 for 7 bit addrs, != 0 for 10 bit   */</span>
<a name="l00114"></a>00114 
<a name="l00115"></a><a class="code" href="i2c-dev_8h.html#4c2f02700f22d4f76c670966aed5079a">00115</a> <span class="preprocessor">#define I2C_FUNCS   0x0705  </span><span class="comment">/* Get the adapter functionality */</span>
<a name="l00116"></a><a class="code" href="i2c-dev_8h.html#7645f9831bcbbae2339fcff4d85691be">00116</a> <span class="preprocessor">#define I2C_RDWR    0x0707  </span><span class="comment">/* Combined R/W transfer (one stop only)*/</span>
<a name="l00117"></a><a class="code" href="i2c-dev_8h.html#2a72d7072db21c407f82e6e73854b38f">00117</a> <span class="preprocessor">#define I2C_PEC     0x0708  </span><span class="comment">/* != 0 for SMBus PEC                   */</span>
<a name="l00118"></a>00118 
<a name="l00119"></a><a class="code" href="i2c-dev_8h.html#0839b8a41f6fd5560c6a970e1e04f624">00119</a> <span class="preprocessor">#define I2C_ACK_TEST    0x0710  </span><span class="comment">/* See if a slave is at a specific address */</span>
<a name="l00120"></a>00120 
<a name="l00121"></a>00121 
<a name="l00122"></a><a class="code" href="i2c-dev_8h.html#4e9d483fb9eb1074646726ce518b1d4d">00122</a> <span class="preprocessor">#define I2C_SMBUS   0x0720  </span><span class="comment">/* SMBus-level access */</span>
<a name="l00123"></a>00123 
<a name="l00124"></a>00124 <span class="comment">/* ... algo-bit.c recognizes */</span>
<a name="l00125"></a><a class="code" href="i2c-dev_8h.html#db1350ea4db57087ea86ba9722a80ede">00125</a> <span class="preprocessor">#define I2C_UDELAY  0x0705  </span><span class="comment">/* set delay in microsecs between each  */</span>
<a name="l00126"></a>00126                             <span class="comment">/* written byte (except address)    */</span>
<a name="l00127"></a><a class="code" href="i2c-dev_8h.html#3e36065af9761870927b6d4ab1796783">00127</a> <span class="preprocessor">#define I2C_MDELAY  0x0706  </span><span class="comment">/* millisec delay between written bytes */</span>
<a name="l00128"></a>00128 
<a name="l00129"></a>00129 <span class="comment">/* ----- I2C-DEV: char device interface stuff ------------------------- */</span>
<a name="l00130"></a>00130 
<a name="l00131"></a><a class="code" href="i2c-dev_8h.html#948a746545caeae5f7c84e9fa8b25e2c">00131</a> <span class="preprocessor">#define I2C_MAJOR   89      </span><span class="comment">/* Device major number      */</span>
<a name="l00132"></a>00132 
<a name="l00133"></a>00133 <span class="preprocessor">#endif </span><span class="comment">/* _LINUX_I2C_DEV_H */</span>
</pre></div><hr size="1"><address style="text-align: right;"><small>Erzeugt am Thu Dec 13 13:57:32 2007 für LCV Framework von&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
</body>
</html>
